package com.candy.control;

import com.candy.bean.UserInfo;
import com.candy.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
//@CrossOrigin进行处理跨域
@RestController
public class LoginController {
    @Autowired
    LoginService loginService;

    @RequestMapping("/login")
    public String login(UserInfo userInfo){
        System.out.println("已接收到前端发送过来的登录请求");
       boolean ok= loginService.login(userInfo);
       if(ok){
           return "ok";
       }else {
           return "eg";
       }
    }





}
